﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using Accounting.Library;
using Styles;

namespace csla4Skeleton.UI.SL.NghiepVu.Kho.K_PhieuXuatKho
{
    public class PhieuXuatKhoStatusStyle : GridViewRowStyleSelector
    {
        BackgroundStatusColorProvider colorProvider = new BackgroundStatusColorProvider();
        public override Style SelectStyle(object item, DependencyObject container)
        {
            Style style = null;
            if (item is K_PhieuXuatKhoInfo)
            {
                K_PhieuXuatKhoInfo PhieuXuatKhoInfo = item as K_PhieuXuatKhoInfo;
                if (PhieuXuatKhoInfo.DaXuatHoaDonBan)
                {
                    style = GetBackGroundStyle(colorProvider.K_PhieuXuatKho_PhatSinhHoaDonBan);
                }
                else if (PhieuXuatKhoInfo.DaKyGui)
                {
                    style = GetBackGroundStyle(colorProvider.K_PhieuXuatKho_PhatSinhKyGui);
                }
                else if (PhieuXuatKhoInfo.XuatDeSanXuat)
                {
                    style = GetBackGroundStyle(colorProvider.K_PhieuXuatKho_PhatSinhSanXuat);
                }
                else
                {
                    style = GetBackGroundStyle(colorProvider.K_PhieuXuatKho_ChuaCoNghiepVuPhatSinh);
                }
            }
            return style;
        }
    }
}